package com.xj.homework.pattern.singleton;

/**
 * 饿汉式
 * 在静态变量中创建对象，对象初始化是创建对象实例，使用时直接返回
 */
public class HungerSingleTon {
    public static HungerSingleTon instance = new HungerSingleTon();

    private HungerSingleTon() {}

    public static HungerSingleTon getInstance() {
        return instance;
    }
}
